package com.xqboss.apps.dto.punch;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalTime;

/**
 * @author Trent
 * @date 2023/8/15
 */
@Data
@ApiModel
public class AddPunchRuleDto {

    /**
     * 规则名称
     */
    @ApiModelProperty(value = "规则名称", required = true)
    @NotNull(message = "请输入规则名称")
    @Length(min = 2, max = 20, message = "规则名称长度为2-20")
    private String name;

    /**
     * 开始时间
     */
    @ApiModelProperty(value = "开始时间", required = true, example = "12:33")
    @NotNull(message = "请输入开始时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm")
    private LocalTime startTime;

    /**
     * 结束时间
     */
    @ApiModelProperty(value = "结束时间", required = true, example = "16:00")
    @NotNull(message = "请输入结束时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm")
    private LocalTime endTime;

    /**
     * 打卡次数
     */
    @ApiModelProperty(value = "打卡次数", required = true)
    @NotNull(message = "请输入打卡次数")
    @Min(value = 1, message = "最少打卡1次")
    private Integer punchCount;

    /**
     * 打卡间隔时间
     */
    @ApiModelProperty(value = "打卡间隔，单位秒", required = true)
    private Integer intervalTime;

    @ApiModelProperty(value = "排序")
    private Integer sort = 0;
}
